"""
    HTTP 服务端
"""
from socket import *

sock=socket()
sock.bind(("0.0.0.0",60000))
sock.listen(5)

while True:
    #等待浏览器连接
    connfd,addr=sock.accept()
    print("Connect from",addr)

    #接收HTTP请求
    data=connfd.recv(1024)
    print(data.decode())

    # 发送响应
    response="""HTTP/1.1 200 OK
Content-Type:text/html

Hello world
"""
    connfd.send(response.encode())



    connfd.close()
    sock.close()

































